@extends('layouts.default')
@section('content')     
<div class="box">
    <header>
        <div class="icons">
            <i class="fa fa-table"></i>
        </div><h5>{{ Lang::get('messages.problems') }}</h5>
        <div class="toolbar">  
            {{ Helpers\Helper::fa_link_to_action('glyphicon glyphicon-plus',
                            'RepairController@problems_create',
                            Lang::get('messages.add_btn'),null,array(
                            'class'=>'btn btn-success btn-sm btn-round'))
            }}     
        </div>
        
    </header>
    <div id="collapse4" class="body">
        <table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>{{ Lang::get('messages.make') }}</th>
                    <th>{{ Lang::get('messages.model')}}</th>
                    <th>{{ Lang::get('messages.problem')}}</th>                                   
                    <th>{{ Lang::get('messages.status')}}</th>
                    <th>{{ Lang::get('messages.date')}}</th>
                    <th>{{ Lang::get('messages.action')}}</th>
                </tr>
            </thead>
            <tbody>                             
                @foreach ($values as $v)
                <tr>    
                    <td>{{ $v->id   }}</td>                                  
                    <td>{{ $v->Make }}</td>  
                    <td>{{ $v->Model}}</td>
                    <td>{{ $v->type }}</td>
                    <td>{{ $v->status_id  }}</td>
                    <td>{{ $v->created_at }}</td>
                    @if($v->status_id == '0')
                    <td>{{link_to_action('RepairController@repair_problem', 
                            'Repair', array('id'=>$v->vehicle_id.'~'.$v->type.'~'.$v->id))}}</td>
                    @else
                    <td>Repaired</td>
                    @endif
                </tr>                                                            
                @endforeach
            </tbody>
        </table>
    </div>
</div>       
@stop
